<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>父子组件</title>
</head>
<body>
  <div id="app">
    <input type="color" v-model="color">
    <my-root></my-root>
  </div>
</body>
<template id="root">
  <div style="width: 100%;height: 500px;background-color: #ccc;">
    <my-box></my-box>
  </div>
</template>
<template id="box">
  <div :style="{ width: '300px', height: '300px', 'background-color': $root.color }"></div>
</template>
<script src="../lib/vue.global.js"></script>
<script>

  const bus = Vue.createApp()
  console.log(bus)
  

  const Box = {
    template: '#box'
  }

  const Root = {
    template: '#root',
    components: {
      MyBox: Box
    },
    data () {
      return {
        color: '#0f0'
      }
    }
  }
  const app = Vue.createApp({
    components: {
      MyRoot: Root
    },
    data () {
      return {
        color: '#00f'
      }
    }
  })

  app.mount('#app')
</script>
</html>